<header id="topbar" class="affix" style="top:60px;">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="#op/account_black_customer/">用户账号管理</a>
            </li>
        </ol>
    </div>
    <div class="topbar-right">
        <div class="ml15 ib va-m" id="toggle_sidemenu_r">
            <a href="#" class="pl5"> <i class="fa fa-sign-in fs22 text-primary"></i>
            </a>
        </div>
    </div>

</header>

<section id="content" class="animated fadeIn">
    <% if(items.length > 0){ %>
    <div class="panel overflow">
        <table class="table table-striped fs13" id="main-list">
            <thead>
                <tr class="bg-light">
                    <th>用户ID</th>
                    <th>用户昵称</th>
                    <th>渠道号</th>
                    <th>注册时间</th>
                    <th>当前状态</th>
                    <th>提现状态</th>
                    <th>绑定手机号</th>
                    <th>绑定银行卡</th>
                    <th>绑定微信</th>
                    <th>绑定支付宝</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="admin-form">
                <% _.each(items, function(item){
                    var withdraw_black = false;
                    if(item.withdraw_black) withdraw_black = true;
                %>
                    <tr data-id="<%= item.id %>">
                        <td><a href="#stats/account/?id=<%= item.user_id %>"><%= item.user_id %></a></td>
                        <td><%= item.user_name %></td>
                        <td><%= item.channel %></td>
                        <td><%= item.created_at %></td>
                        <td><%= item.account_status %></td>
                        <% if(withdraw_black){ %>
                        <td data-banned-status="1">黑名单</td>
                        <% }else{ %>
                        <td data-banned-status="0">正常</td>
                        <% } %>
                        <td><%= item.phone || '-' %></td>
                        <td><%= item.bank_card || '-' %></td>
                        <td><%= item.wechat || '-' %></td>
                        <td><%= item.alipay || '-'%></td>
                        <td>
                        <a class="glyphicons glyphicons-pencil modify-item" href="javascript:;"></a>
                        </td>
                    </tr>
                <%
                }) %>
            </tbody>
        </table>
    </div>
    <div><div class="pull-left" id="page-tips"></div><div id="paginator"></div></div>
    <% }else{ %>
    <h4 class="text-muted">请从右侧进行搜索...</h4>
    <% } %>
</section>

<aside id="sidebar_right" class="nano" style="top: 110px;">
    <div class="p20 admin-form">
        <h4 class="mt5 text-muted fw500">过滤条件：</h4>
        <hr class="short">
        <div class="section mb15">
            <label class="field prepend-icon">
                <input title="用户ID" type="text" id="searchUid" class="gui-input" data-field="account_id" placeholder="用户ID" value="<%= searched.account_id %>">
                <label class="field-icon"><i class="fa fa-tag"></i>
                </label>
            </label>
        </div>
<!--        <div class="section mb15">
            <label class="field prepend-icon">
                <input title="用户ID" type="text" id="searchIP" class="gui-input" data-field="account_ip" placeholder="用户IP" value="<%= searched.account_ip %>">
                <label class="field-icon"><i class="fa fa-tag"></i>
                </label>
            </label>
        </div>
        <div class="section mb15">
            <label class="field prepend-icon">
                <input title="用户ID" type="text" id="searchAid" class="gui-input" data-field="account_aid" placeholder="用户设备" value="<%= searched.account_aid %>">
                <label class="field-icon"><i class="fa fa-tag"></i>
                </label>
            </label>
        </div>
        <h6 class="fw400">当前状态</h6>
        <div class="section mb15">
            <label class="field select">
                <select id="searchType" name="searchType" data-field="type">
                    <option value="-1" >未选择</option>
                    <option value="0" <%= searched.target_type == "0" ? 'selected' : '' %>>一般用户</option>
                    <option value="1" <%= searched.target_type == "1" ? 'selected' : '' %>>测试账号</option>
                    <option value="2" <%= searched.target_type == "2" ? 'selected' : '' %>>黑名单用户</option>
                </select>
                <i class="arrow double"></i>
            </label>
        </div>
        <h6 class="fw400">提现状态</h6>
        <div class="section mb15">
            <label class="field select">
                <select id="searchWithdrawType" name="searchWithdrawType" data-field="withdraw_type">
                    <option value="-1" >未选择</option>
                    <option value="0" <%= searched.withdraw_target_type == "0" ? 'selected' : '' %>>可提现</option>
                    <option value="1" <%= searched.withdraw_target_type == "1" ? 'selected' : '' %>>提现黑名单</option>
                </select>
                <i class="arrow double"></i>
            </label>
        </div>
        <h6 class="fw400">提现账号绑定状态</h6>
        <div class="section mb15">
            <label class="field select">
                <select id="searchBindType" name="searchBindType" data-field="bind_type">
                    <option value="-1" >未选择</option>
                    <option value="0" <%= searched.bind_type == "0" ? 'selected' : '' %>>绑定银行卡</option>
                    <option value="2" <%= searched.bind_type == "2" ? 'selected' : '' %>>绑定微信</option>
                    <option value="1" <%= searched.bind_type == "1" ? 'selected' : '' %>>绑定支付宝</option>
                    <option value="phone" <%= searched.bind_type == "phone" ? 'selected' : '' %>>绑定手机号</option>
                </select>
                <i class="arrow double"></i>
            </label>
        </div> -->
        <hr class="short">

        <div class="row">
            <div class="col-md-6">
                <button class="btn btn-primary btn-block form-control" id="search">搜索</button>
            </div>
        </div>

    </div>
</aside>

<!-- Panel popup -->
<div id="editAccount" class="popup-basic popup-lg bg-none mfp-with-anim mfp-hide">
    <div class="panel">
        <div class="panel-heading">
            <span class="panel-icon"><i class="fa fa-pencil"></i></span>
            <span class="panel-title">历史记录</span>
        </div>
        <div class="panel-body">
            <form id="AccountForm" class="form-horizontal" role="form">
            </form>
        </div>
        <div class="panel-footer text-right">
            <div class="mb5">
                <button class="btn btn-primary btn-sm banned_account" type="button" id="blackUser">加入黑名单</button>
                <button class="btn btn-primary btn-sm unbanned_account" type="button" id="unblackUser">移出黑名单</button>
                <button class="btn btn-primary btn-sm added_withdraw_black" type="button" data-type="black_uid" id="blackUserWithdraw">加入提现黑名单</button>
                <button class="btn btn-primary btn-sm removed_withdraw_black" type="button" data-type="black_uid" id="unblackUserWithdraw">移出提现黑名单</button>
                <button class="btn btn-primary btn-sm added_withdraw_black" type="button" data-type="test_uid" id="blackTestWithdraw">加入测试名单</button>
                <button class="btn btn-primary btn-sm removed_withdraw_black" type="button" data-type="test_uid" id="unblackTestWithdraw">移出测试名单</button>
            </div>
            <div>
                <button class="btn btn-primary btn-sm reset_phone" type="button" id="unbindUserPhone">解绑手机号</button>
                <button class="btn btn-primary btn-sm unbind_financial" type="button" data-account_type="bank_card" id="unbindBankcard">解绑银行卡</button>
                <button class="btn btn-primary btn-sm unbind_financial" type="button" data-account_type="alipay" id="unbindAlipay">解绑银行卡</button>
                <button class="btn btn-primary btn-sm unbind_financial" type="button" data-account_type="wechat" id="unbindWechat">解绑微信</button>
                <button class="btn btn-primary btn-sm" type="button" id="submitClose">关闭</button>
            </div>
        </div>
    </div>
</div>

<!-- 封号复选框 -->
<div id="AccountBlackDialog" class="withdraw-limit-dialog" style="display:none">
    <div class="content">
        <span class="withdraw-limit" id = "account_id"></span>
        <span class="withdraw-limit">请输入封号理由:</span>
        <div>
            <input id="black-content" type="text" placeholder="">
        </div>
        <div class="">
            <button id="closeBtn" onclick="account_black.closeAccountBlackDialog()" type="button" class="btn btn-danger">关闭</button>
            <button id="saveBtn" onclick="account_black.accountBlack()" type="button" class="btn btn-success">确定</button>
        </div>
    </div>
</div>

